package com.ljc.gld;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();  //n珠
        int w = s.nextInt();  //w高度不超过w  cm
        int k = s.nextInt();  // 长高k 厘米
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }
        int money = 0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] <= w){
                //不超过就不用管
                continue;
            }
            int temp = arr[i];
            for(int j = i+1 ; j < n;j++){
                arr[j] = arr[j]+1;
            }
            money+=(temp-w);
        }
        System.out.println(money);
    }
}
